<include file="Public:head" title='' />
<script src="__PUBLIC__/js/other/validate.js"></script>
<script type="text/javascript">
    $(function() {
        $("#form").validate({
            errorPlacement: function(error, element) {
                var error_td = element.parent('td');
                error_td.find('label.error').hide();
                error_td.append(error);
            },
            rules: {
                name: {
                    required: true
                },
                url: {
                    url: true
                }

            },
            messages: {
                name: {
                    required: '友情链接名称不能为空'
                },
                url: {
                    url: "清正确填写链接格式"
                }

            }
        });
    });
</script>
<div class="main-container" id="main-container">
    <div class="main-container-inner">
        <include file="Public:left" />
        <div class="main-content">
            <div class="breadcrumbs" id="breadcrumbs">
                <ul class="breadcrumb">
                    <li><i class="icon-home home-icon"></i><a href="__APP__/{$Think.MODULE_NAME}">首页</a></li>
                    <li><a href="{:U('Index/friends')}">友情链接管理</a></li>
                    <li class="active">友情链接{$Think.get.id|getPageType}</li>
                </ul>
            </div>
            <div class="page-content">
                <div class="row">
                    <div class="col-xs-12">
                        <div class="row">
                            <div class="col-xs-12">
                                <h3 class="header smaller lighter blue">友情链接{$Think.get.id|getPageType}</h3>

                                <form action="{:U('Index/friends_detail_post')}" method="POST" id="form"  enctype="multipart/form-data">
                                    <table class="table table_detail">
                                        <tbody>
                                            <tr>
                                                <td class="td_left">友情链接名称:</td>
                                                <td>

                                                    <input name="name"  type="text" class="col-xs-4"  value="{$detail.name}"/>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td class="td_left">链接地址:</td>
                                                <td>
                                                    <input name="url" type="text" class="col-xs-4"  value="{$detail.url}"/>
                                                </td>
                                            </tr>
<!--                                            <tr id="zip_area_tr">
                                                <td class="td_left">上传压缩文件</td>
                                                <td>
                                                    <a class="btn btn-app btn-purple btn-sm" id="zip_upload_btn" href="javascript:;">
                                                        <i class="icon-cloud-upload bigger-200"></i>
                                                        Upload
                                                    </a>
                                                    <div id="zip_upload_area" style="position: relative;"></div>
                                                    <div id="zip_show_area">
                                                        <if condition="$detail.id gt 0 && $detail.zip neq ''">
                                                          <a href="__APP__/{$detail.zip}">{$detail.zip}</a>
                                                        </if>
                                                    </div>
                                                    <input type="text" id="zip" name="zip" value="" autocomplete="off" style="position: absolute;left:-9999px"/>
                                                </td>
                                            </tr>-->

                                            <tr id="tr_name">
                                                <td class="td_left">排序:</td>
                                                <td>
                                                    <input name="ord" type="text" class="common_txt" value="{$detail.ord}" autocomplete="off" />
                                                </td>
                                            </tr>
                                            <tr>
                                                <td class="td_left"></td>
                                                <td>
                                                    <input type='hidden' name='id' value='{$Think.get.id}'/>
                                                    <button class="btn btn-info btn-sm" type="submit">
                                                        <i class="icon-ok bigger-110 "></i>
                                                        保 存
                                                    </button>

                                                    <button class="btn btn-sm reset" type="button" onclick="goUrl(-1)">
                                                        <i class="icon-undo bigger-110"></i>
                                                        返 回
                                                    </button>
                                                </td>
                                            </tr>
                                        </tbody>
                                    </table>
                                </form>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <include file="Public:setting" />
    </div>
</div>
<script>
    function addFriends() {
        var tr = "<tr><td class='td_left'></td>\n\
<td>名称：<input name='name[]' type='text' class='common_txt'  value=''/>链接：<input name='url[]' type='text' class='common_txt'  value=''/>\n\
<a onclick=$(this).parent().parent().remove()>删除</a></td></tr>";
        $('#tr_name').before(tr);
    }
</script>
<include file="Public:foot" />
<include file="Public:plupload" />